package com.wxg.common.test;

import org.junit.After;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;

@ContextConfiguration(locations = { "classpath:spring-mybatis.xml", "classpath:spring-mvc.xml" })
@WebAppConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class BaseTestController {
	
	public final static String CONTENT_TYPE_JSON = "application/json;charset=UTF-8";
    public final static String CONTENT_ENCODE = "UTF-8";
    
    @Autowired
    protected WebApplicationContext webAppContext;

    protected MockMvc mockMvc;
    
    @Before
    public void init() throws Exception {
    	mockMvc = MockMvcBuilders.webAppContextSetup(webAppContext).build();
    }

    @After
    public void down() throws Exception {
    }
    
}
